package com.wt.admin.service.sys.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wt.admin.domain.dto.sys.SysLogFindDTO;
import com.wt.admin.domain.entity.sys.SysOperationLogEntity;
import com.wt.admin.mapper.sys.SysOperationLogMapper;
import com.wt.admin.service.sys.SysOperationLogService;
import com.wt.admin.util.PageUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import jakarta.annotation.Resource;
import java.util.List;

@Service
public class SysOperationLogServiceImpl  extends ServiceImpl<SysOperationLogMapper, SysOperationLogEntity> implements SysOperationLogService {

    @Resource
    private SysOperationLogMapper sysOperationLogMapper;

    @Override
    public PageUtil.PageVO<SysOperationLogEntity> find(PageUtil.PageDTO<SysLogFindDTO> data) {
        return PageUtil.findPage(data, (page) -> sysOperationLogMapper.find(page,data.getData()));
    }

    @Transactional
    @Override
    public void add(List<SysOperationLogEntity> poll) {
        saveBatch(poll);
    }

}
